package xml;


import java.io.Serializable;
import java.util.HashMap;
/**
 * java |android 客户端请求结构
 *  @author 3979434@qq.com
 *
 */
public class SentBody implements Serializable {

	/**
	 * @author 3979434@qq.com 客户端发送消息对象
	 */
	private static final long serialVersionUID = 1L;

	private String type;
	private long reciever;

	public long getTo() {
		return reciever;
	}

	public void setTo(long reciever) {
		this.reciever = reciever;
	}

	private long timestamp;

	public SentBody() {
		
		timestamp = System.currentTimeMillis();
	}

	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	@Override
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
		buffer.append("<request>");
		buffer.append("<type>").append(type).append("</type>");
		buffer.append("<reciever>").append(reciever).append("</reciever>");
		buffer.append("<data>");
		buffer.append("</data>");
		buffer.append("<timestamp>").append(timestamp).append("</timestamp>");
		buffer.append("</request>");
		return buffer.toString();
	}

	public String toXmlString() {

		return toString();
	}
}
